Don't crash when finalizing an unused GtkTextChildAnchor. (#132260,
authorMatthias Clasen <maclas@gmx.de>
Sat, 31 Jan 2004 22:11:07 +0000 (22:11 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Sat, 31 Jan 2004 22:11:07 +0000 (22:11 +0000)
Sat Jan 31 23:13:43 2004  Matthias Clasen  <maclas@gmx.de>

* gtk/gtktextchild.c (gtk_text_child_anchor_finalize): Don't
crash when finalizing an unused GtkTextChildAnchor.  (#132260,
muppet)

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtktextchild.c

index 65e754e6f38f24084380c4c71f6f35d1f78d74dd..878e8e02a15ad7444e9533b6953339977c953814 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Sat Jan 31 23:13:43 2004  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtktextchild.c (gtk_text_child_anchor_finalize): Don't
+       crash when finalizing an unused GtkTextChildAnchor.  (#132260,
+       muppet)
+
 Sat Jan 31 22:41:57 2004  Matthias Clasen  <maclas@gmx.de>
 
        * gtk/gtktreemodel.c (gtk_tree_model_rows_reordered): Correct
index 65e754e6f38f24084380c4c71f6f35d1f78d74dd..878e8e02a15ad7444e9533b6953339977c953814 100644 (file)
@@ -1,3 +1,9 @@
+Sat Jan 31 23:13:43 2004  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtktextchild.c (gtk_text_child_anchor_finalize): Don't
+       crash when finalizing an unused GtkTextChildAnchor.  (#132260,
+       muppet)
+
 Sat Jan 31 22:41:57 2004  Matthias Clasen  <maclas@gmx.de>
 
        * gtk/gtktreemodel.c (gtk_tree_model_rows_reordered): Correct
index 65e754e6f38f24084380c4c71f6f35d1f78d74dd..878e8e02a15ad7444e9533b6953339977c953814 100644 (file)
@@ -1,3 +1,9 @@
+Sat Jan 31 23:13:43 2004  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtktextchild.c (gtk_text_child_anchor_finalize): Don't
+       crash when finalizing an unused GtkTextChildAnchor.  (#132260,
+       muppet)
+
 Sat Jan 31 22:41:57 2004  Matthias Clasen  <maclas@gmx.de>
 
        * gtk/gtktreemodel.c (gtk_tree_model_rows_reordered): Correct
index 65e754e6f38f24084380c4c71f6f35d1f78d74dd..878e8e02a15ad7444e9533b6953339977c953814 100644 (file)
@@ -1,3 +1,9 @@
+Sat Jan 31 23:13:43 2004  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtktextchild.c (gtk_text_child_anchor_finalize): Don't
+       crash when finalizing an unused GtkTextChildAnchor.  (#132260,
+       muppet)
+
 Sat Jan 31 22:41:57 2004  Matthias Clasen  <maclas@gmx.de>
 
        * gtk/gtktreemodel.c (gtk_tree_model_rows_reordered): Correct
index 65e754e6f38f24084380c4c71f6f35d1f78d74dd..878e8e02a15ad7444e9533b6953339977c953814 100644 (file)
@@ -1,3 +1,9 @@
+Sat Jan 31 23:13:43 2004  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtktextchild.c (gtk_text_child_anchor_finalize): Don't
+       crash when finalizing an unused GtkTextChildAnchor.  (#132260,
+       muppet)
+
 Sat Jan 31 22:41:57 2004  Matthias Clasen  <maclas@gmx.de>
 
        * gtk/gtktreemodel.c (gtk_tree_model_rows_reordered): Correct
index 0cc68f347fbb2ecca04f73617a90e946ff54deee..a92944e3d5bee499dd4482bf6b0eabe7eae791f2 100644 (file)
@@ -377,24 +377,27 @@ gtk_text_child_anchor_finalize (GObject *obj)
 
   seg = anchor->segment;
   
-  if (seg->body.child.tree != NULL)
+  if (seg)
     {
-      g_warning ("Someone removed a reference to a GtkTextChildAnchor "
-                 "they didn't own; the anchor is still in the text buffer "
-                 "and the refcount is 0.");
-      return;
-    }
+      if (seg->body.child.tree != NULL)
+        {
+          g_warning ("Someone removed a reference to a GtkTextChildAnchor "
+                     "they didn't own; the anchor is still in the text buffer "
+                     "and the refcount is 0.");
+          return;
+        }
       
-  tmp_list = seg->body.child.widgets;
-  while (tmp_list)
-    {
-      g_object_unref (tmp_list->data);
-      tmp_list = g_slist_next (tmp_list);
-    }
+      tmp_list = seg->body.child.widgets;
+      while (tmp_list)
+        {
+          g_object_unref (tmp_list->data);
+          tmp_list = g_slist_next (tmp_list);
+        }
   
-  g_slist_free (seg->body.child.widgets);
+      g_slist_free (seg->body.child.widgets);
   
-  g_free (seg);
+      g_free (seg);
+    }
 
   anchor->segment = NULL;
 }